﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	 
	<jsp:include page="/AdminV3/include/main.jsp"></jsp:include>

 	<script type="text/javascript">
 			Ext.onReady(function(){
 			
 				// 表头
 				var cm = new Ext.grid.ColumnModel([
 					{header:'ID',dataIndex:'id'},
 					{header:'笔名',dataIndex:'penName'},
 					{header:'姓名',dataIndex:'perName'},
 					{header:'密码',dataIndex:'password'},
 					{header:'年龄',dataIndex:'age'},
 					{header:'生日',dataIndex:'birthday2'}
 				]);
 				 
 				// 表格
 				var store = new Ext.data.Store({
	 				proxy:new Ext.data.HttpProxy({url:'rest/UserService/selectApp'}),
	 				reader:new Ext.data.JsonReader({
                      totalProperty:'totalProperty',//最大多少条数据
	                      root:'root'
	 				},[
	 					{name:'id'},
	 					{name:'penName'},
	 					{name:'perName'},
	 					{name:'password'},
	 					{name:'age'},
	 					{name:'birthday2'}
	 				  ]
	 				)
 				});
 				var grid = new Ext.grid.GridPanel({
 						cm:cm,
 						store:store,
 						//autoWidth:true,// 最佳的宽度显示
 						width:500,
 						height:500,
 						renderTo:'grid',
 						tbar:new Ext.PagingToolbar({
 							store:store,
 							pageSize:5,
 							displayInfo:true,
 							displayMsg: '显示 {0} - {1} 条，共计 {2} 条',   
 							emptyMsg:'空'
 						})
 				});
 				store.load({params:{start:0,limit:5}});
 				
 				
 				var w =new  Ext.Window({
					width:300,
					height:400,
					items:[grid]
 				});
				w.show();
			});
 	</script>
  </head>
  <body>
       
       
			<div id="grid"></div>  
			
	
  </body>
</html>
